package com.insurance.mapper;

import com.insurance.pojo.UserOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: 李辽
 * Date: 2020/10/30 15:02
 * Description:
 * Version: V1.0
 */
public interface UserKFMapper {
    /**
     * 通过用户id查询出该用户的信息，用于判断原始密码是否正确
     * @param user_id
     * @return
     */
    Map queryUserPwdByUserId(@Param("user_id") int user_id);


    /**
     * 更改用户密码
     * @param user_id
     * @param new_pwd
     * @return
     */
    int updateUserPwdByUserId(@Param("user_id") int user_id,@Param("new_pwd") String new_pwd);

    /**
     * 通过用户id查询用户所拥有的优惠劵接口
     * @param user_id
     * @return
     */
    List<Map> queryUserCouponByUserId(int user_id);

    /**
     * 根据区域id查询检修厂,用于前端渲染下拉框
     * @param area_city_id
     * @return
     */
    List<Map> queryRepairByAreaId(int area_city_id);

    /**
     * 根据区域id查询4s店，前面查询省市的接口
     * @param area_city_id
     * @return
     */
    List<Map> query4SByAreaId(int area_city_id);

    /**
     * 根据区域id查询司机
     * @param area_city_id
     * @return
     */
    List<Map> queryDriverByAreaId(int area_city_id);

    /**
     * 根据用户ID查询有无保单
     * @param user_id
     * @return
     */
    List<Map> queryInsuranceByUserId(int user_id);

    List<Map> queryUserOrderAllUnreadByUserId(int user_id);

    List<Map> queryOrder(int user_id);

    String[] queryOrderImg(Object order_number);

    String[] queryOrderRegImg(Object order_number);

    int addOrder(UserOrder userOrder);

    int addImgAddress(@Param("order_id") int order_id,@Param("img_address") String[] img_address);

    int addReImgAddress(@Param("order_id") int order_id,@Param("img_address") String[] img_address);

    Double querOrderTypePrice(Integer orderType);

    int addPayInfo(@Param("pay_number") String pay_number, @Param("orderNumber") String orderNumber, @Param("price") Double price);

    Map queryPayOrderByOrderNumber(String orderNumber);

    List<Map> queryOwnerCardByUserId(int user_id);
}
